﻿<Window x:Class="OnlineStoreSystem.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <DataTemplate x:Key="ItemDataTemplate">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <TextBlock Grid.Row="0" Grid.Column="0"
                           Text="{Binding Name}" />
                <TextBlock Grid.Row="1" Grid.Column="0"
                           Text="{Binding Price}" />
                
                <TextBox Grid.Row="0" Grid.Column="1" Grid.RowSpan="2"
                         Text="{Binding Quantity}" />
            </Grid>
        </DataTemplate>
    </Window.Resources>
    
    <StackPanel Orientation="Vertical">
        <ListBox ItemsSource="{Binding Items}" ItemTemplate="{StaticResource ItemDataTemplate}" />
        <Button Content="Place order" Command="{Binding PlaceOrderCommand}" />
    </StackPanel>
</Window>
